package cn.zbh.exception;

import cn.zbh.enums.GlobalEnum;
import lombok.Data;

@Data
public class GlobalCustomException extends RuntimeException{

    private  String errorMsg;
    private String errorCode;

    public GlobalCustomException(){
        super();
    }

    public GlobalCustomException( String errorMsg,String errorCode){
        super(errorMsg);
        this.errorCode=errorCode;
        this.errorMsg=errorMsg;
    }

    public GlobalCustomException(GlobalEnum globalEnum){
        super(globalEnum.getErrorMessage());
        this.errorCode=globalEnum.getErrorCode();
        this.errorMsg=globalEnum.getErrorMessage();
    }

}
